Simplify _gtk_text_buffer_get_line_log_attrs()
authorSébastien Wilmet <swilmet@gnome.org>
Wed, 20 Aug 2014 17:06:05 +0000 (19:06 +0200)
committerSébastien Wilmet <swilmet@gnome.org>
Thu, 21 Aug 2014 16:43:34 +0000 (18:43 +0200)
commit706c8e9c8d29a93fabc1d787894827b709139b6e
treebe70195da43795b96360e1da12c2738a88bf483c
parent83bc0c4bb19ac0a61553aba6e9a370aba0ab6e13
Simplify _gtk_text_buffer_get_line_log_attrs()

NULL was returned in case of an empty last line. Every users needed to
special-case this. Now it will return the expected result: char_len of 0
with one PangoLogAttr.

In compute_log_attrs(), 'paragraph' will be the empty string "" with
'char_len' == 0.
pango_get_log_attrs() works fine with an empty string, it will return
one correct PangoLogAttr (because there is one text position for the
empty string).

It fixes the unit tests for gtk_text_iter_is_cursor_position().

https://bugzilla.gnome.org/show_bug.cgi?id=156164
gtk/gtktextbuffer.c
gtk/gtktextiter.c
testsuite/gtk/textiter.c